package com.xuecheng.content.api;

import com.xuecheng.content.model.dto.CourseCategoryTreeDto;
import com.xuecheng.content.service.CourseCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 26455
 * @version 1.0
 * @description TODO
 * @date 2023/2/7 9:27
 */


@Slf4j
@Api(value = "课程分类相关接口", tags = "课程分类相关接口")
@RestController
@RequestMapping("/course-category")
public class CourseCategoryController {
    @Autowired
    private CourseCategoryService categoryService;

    @ApiOperation("课程分类查询接口")
//    @GetMapping("/tree-nodes")
    public List<CourseCategoryTreeDto> treeNode() {
        return categoryService.queryTreeNodes("1");
    }

    @ApiOperation("课程分类查询接口")
    @GetMapping("/tree-nodes")
    public List<CourseCategoryTreeDto> treeNode_2() {
        return categoryService.queryTreeNodes_2();
    }

}
